#ifndef _CROSSENGINE_CROSSOBJECTMGR_H_
#define _CROSSENGINE_CROSSOBJECTMGR_H_
#include "crossobject.h"
#include "container.h"
#include "list.h"
#include "timer.h"

class CrossObjectMgr
{
public:
    virtual ~CrossObjectMgr();
    CrossObjectMgr(){INIT_LIST_HEAD(&_events);}
    bool AddObject(CrossObject* obj);
    CrossObject* FindObject(uint64 objCode);
    CrossObject* RemoveObject(uint64 objCode);
    void Tick();
    void PostEvent(uint64 code,CrossEvent* e);
private:
    Cross::HashMap<uint64,CrossObject*> _objContainer;
    list_head _events;
};

void CrossPostTimer(uint32 deltaTick,Cross::GTimerFunc func);

#endif//_CROSSENGINE_CROSSOBJECTMGR_H_
